package com.yoomiito.app.ui.anyview.sureorder.bottom

import android.content.Context
import android.graphics.drawable.Drawable
import android.view.LayoutInflater
import android.widget.TextView
import com.yoomiito.app.R
import com.yoomiito.app.utils.ColorUtils
import com.yoomiito.app.utils.DensityUtil
import com.yoomiito.app.utils.L

/**
 * 底部按钮---只有一个按钮
 */
class SureOrderBottomView(context: Context) : BaseSureOrderBottomView(context) {
    private var tv: TextView
    init {
        val view = LayoutInflater.from(mContext).inflate(R.layout.view_tv, null, false)
        val lp = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
        addView(view, lp)
        tv = view.findViewById(R.id.tv)
        tv.background = ColorUtils.gradientAndRadius("#FFFF035B","#FFFF246C",DensityUtil.dp2px(24f).toFloat())
        tv.setOnClickListener {
            onClickListener() }
    }

    fun setContent(str:String){
        tv?.text = str
    }

    fun setBackgroundColor(background:Drawable){
        tv?.background = background
    }

}